<template>
  <div>
    <el-table
      :data="LaboratoryHealthList"
      :stripe="true"
      style="width: 100%">
      <el-table-column
        prop="id"
        label="编号">
      </el-table-column>
      <el-table-column
        label="实验室名称">
        <template slot-scope="scope">
          {{scope.row.laboratory.name}}
        </template>
      </el-table-column>
      <el-table-column
        prop="checkDate"
        label="检查时间">
      </el-table-column>

      <el-table-column
        prop="score"
        label="分数">
      </el-table-column>

      <el-table-column
        prop="checker"
        label="检查人">
      </el-table-column>

      <el-table-column
        prop="description"
        label="描述">
      </el-table-column>

      <el-table-column
        label="操作">
        <template slot-scope="scope">
          <el-button @click="deleteById(scope.row.id)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <router-view/>
  </div>
</template>

<script>
    export default {
        name: "LaboratoryHealthList",
      data(){
          return {
            LaboratoryHealthList:[]
          }
      },
      created(){
        this.selectAll();
      },
      methods: {
        deleteById(id){
          this.$confirm("是否确认删除","删除提示").then(()=>{
            this.axios.delete("/laboratoryHealth/delete/"+id).then((resp)=>{
              this.$message.success("删除成功！");
              this.selectAll();
            });
          });
        },
        selectAll(){
          this.axios.get("/laboratoryHealth/selectAll").then((resp)=>{
            this.LaboratoryHealthList=resp.data;
          });
        }
      }
    }
</script>

<style scoped>

</style>
